package com.fi.recogn.enums;

import lombok.AllArgsConstructor;

import java.util.Objects;

/**
 * @author songqiang
 * @desc 表格方向
 * @created on 2023 年 11 月 03
 * @Date 11:22
 * @since 1.0
 */

@AllArgsConstructor
public enum ExcelOrientationEnum {
    /**
     *
     */
    HORIZONTAL(0, "横向"),
    VERTICAL(1, "竖向"),
    COMPLEX(2,"复杂");
    private final Integer orientation;
    private final String desc;


    public Integer orientation() {
        return this.orientation;
    }

    public String desc() {
        return this.desc;
    }

    public static ExcelOrientationEnum parse(Integer orientation){
        for (ExcelOrientationEnum value : values()) {
            if (Objects.equals(value,orientation)) {
                return value;
            }
        }
        return HORIZONTAL;
    }
}
